<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    let ssss = (function () {
        function Tank() {
            this.color = 'red'
            this.run = function () {
                console.log('我是单例模式');
            }
        }
        let sss = null
        return {
            fff: function () {
                if (sss) {
                   return sss
                } else {
                   return sss = new Tank()

                }

            }
        }
    })()
    let a = ssss.fff()
    let b = ssss.fff()
    let c = ssss.fff()
    console.log(a, b, c,a==b);
</script>